<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript">
    function RequestWebService() {
        var data;
        //SOAP 1.1 请求报文格式，1.2在网上可以找到
        data = '<?xml version="1.0" encoding="utf-8"?>';
        data = data + '<soap:Envelope  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:xsd="http://www.w3.org/2001/XMLSchema"  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
        data = data + '<soap:Body>';
        data = data + '<getRank xmlns="http://database.other/">';//这里就是发布的方法名和xml文档中的命名空间地址（图中画线部分）
        data = data + '</getRank>';
        data = data + '</soap:Body>';
        data = data + '</soap:Envelope>';

        var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        var URL="http://127.0.0.1:8080/Service/get?wsdl";
        xmlhttp.Open("POST",URL, false);
        xmlhttp.SetRequestHeader ("Content-Type","text/xml; charset=utf-8"); //SOAP 1.1为text/xml ； 1.2为 application/soap+xml
        xmlhttp.setpa
        xmlhttp.Send(data);
        alert(data);//SOAP请求报文格式

        var text = xmlhttp.responseText;

        alert('结果'+'\n'+text); //SOAP响应报文格式
        document.getElementById("data").innerHTML = text;

    }
</script>
<body>
<input type="button" value="test" onclick="RequestWebService()"></input>
<p id="data"></p>
</body>
</html>